/*
    从键盘上得到0到127之间的一个数，输出二进制
*/
/*#include <stdio.h>
int main() {
    int num = 0 , bit = 0 ;
    printf("请输入一个整数：");
    scanf("%d",&num);
    bit = num & 0x01;
    printf("%8d\r", bit);
    num = num >> 1;
    bit = num & 0x01;
    printf("%7d\r", bit);
    num = num >> 1;
    bit = num & 0x01;
    printf("%6d\r", bit);
    num = num >> 1;
    bit = num & 0x01;
    printf("%5d\r", bit);
    num = num >> 1;
    bit = num & 0x01;
    printf("%4d\r", bit);
    num = num >> 1;
    bit = num & 0x01;
    printf("%3d\r", bit);
    num = num >> 1;
    bit = num & 0x01;
    printf("%2d\r", bit);
    num = num >> 1;
    bit = num & 0x01;
    printf("%d\r\n", bit);
    return 0;
}*/
#include <stdio.h>
int main() {
    int num = 0;
    unsigned char uch = 128;
    printf("请输入一个数字：");
    scanf("%d",&num);
    printf("%d",(num & uch) != 0);
    uch >>= 1; 
    printf("%d",(num & uch) != 0);
    uch >>= 1; 
    printf("%d",(num & uch) != 0);
    uch >>= 1; 
    printf("%d",(num & uch) != 0);
    uch >>= 1; 
    printf("%d",(num & uch) != 0);
    uch >>= 1; 
    printf("%d",(num & uch) != 0);
    uch >>= 1; 
    printf("%d",(num & uch) != 0);
    uch >>= 1; 
    printf("%d\n",(num & uch) != 0);
    return 0;
}
